package com.example.springblog.mapper;

import com.example.springblog.model.UserInfo;
import com.example.springblog.service.UserInfoService;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * Description:
 * Date: 2024-08-26
 * Time: 17:54
 */
@Mapper
public interface UserInfoMapper {

    /**
     * 根据用户名查询用户信息
     * @param userName
     * @return
     */
    @Select("select * from user where delete_flag = 0 and user_name = #{userName}")
    UserInfo selectByName(String userName);

    /**
     * 根据 id 查询用户信息
     * @param id
     * @return
     */
    @Select("select * from user where delete_flag = 0 and id = #{id}")
    UserInfo selectById(Integer id);
}
